layui.use(['table', 'laypage', 'layer', 'form', 'laytpl'], function() {
	var $ = layui.$;
	var table = layui.table;
	var layer = layui.layer;
	var laytpl = layui.laytpl;
	var opername;
	$("#searchBtn").click(function() {
		opername = $("#opername").val();
		if(opername==""){
			layer.msg("请输入搜索条件",{time:500});
		}else{
			getBusiness();
		}
	});
	$("#reLoad").click(function() {
		opername = "";
		layer.msg("刷新", {
			time: 500
		}, function() {
			getBusiness();
		});
	});
	getBusiness();
	function getBusiness() {
		$.ajax({
			type: "post",
			url: "/getBusiness",
			async: true,
			data:{
				opername:opername
			},
			success: function(data) {
				var result = $.parseJSON(data);
				var tablelist = table.render({
					elem: '#test',
					height: 'full-95',
					page: true, //开启分页,
					limits: [10],
					limit: 10,
					id: 'table_reload',
					cols: [
						[ //表头
							{
								checkbox: true,
								fixed: true
							},
							{
								field: 'operaname',
								title: '操作用户',
								width: 250,
							}, {
								field: 'rolename',
								title: '角色',
								width: 200,
							}, {
								field: 'logcontext',
								title: '日志内容',
								width: 400,
							}, 
							{
								field: 'creattime',
								title: '创建时间',
								width: 260,
								sort: true,
							}
						]
					],
					"data": result
				});
			}
		});
	}
	//分页
	

});